import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/biz/course/` + url, ...arg)

/**
 * 课程Api接口管理器
 *
 * @author ahui
 * @date  2023/05/13 21:20
 **/
export default {
	// 获取课程分页
	eduCoursePage(data) {
		return request('page', data, 'get')
	},
	// 获取课程列表
	eduCourseList(data) {
		return request('list', data, 'get')
	},
	// 提交课程表单 edit为true时为编辑，默认为新增
	eduCourseSubmitForm(data, edit = false) {
		return request(edit ? 'add' : 'edit', data)
	},
	// 删除课程
	eduCourseDelete(data) {
		return request('delete', data)
	},
	// 获取课程详情
	eduCourseDetail(data) {
		return request('detail', data, 'get')
	},
	// 直接开课
	eduCourseOffer(data) {
		return request('offer', data, 'get')
	},
	eduCourseExport(data) {
		return request('exportCourse', data, 'get')
	},
	eduCourseSmartExport(data) {
		return request('smartExport', data, 'get')
	},
	eduKlassList(data) {
		return request('eduKlassList', data, 'get')
	},
	eduCourseAddKlass(data) {
		return request('eduCourseAddKlass', data, 'get')
	}
}
